<?php
// +----------------------------------------------------------------------
// | KITEGO-Admin「开箱即用」「人人全栈」
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.kitego.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed KITEGO并不是自由软件，未经许可不能去掉KITEGO相关版权
// +----------------------------------------------------------------------
// | Author: KITEGO Team <bd@kitego.cn>
// +----------------------------------------------------------------------

namespace app\adminapi\controller\v1\setting;

use app\adminapi\services\setting\SystemRoleService;
use kitego\base\BaseController;
use think\App;
use think\response\Json;

class SystemRoleController extends BaseController
{
    private SystemRoleService $service;

    public function __construct(App $app, SystemRoleService $service)
    {
        parent::__construct($app);
        $this->service = $service;
    }

    /**
     * 角色列表
     */
    public function listSystemRole(): Json
    {
        return $this->service->listSystemRole($this->params);
    }

    /**
     * 编辑角色
     */
    public function editSystemRole(): Json
    {
        return $this->service->editSystemRole($this->params);
    }

    /**
     * 批量删除角色
     */
    public function batchDelSystemRole(): Json
    {
        return $this->service->batchDelSystemRole($this->params);
    }

    /**
     * 获取角色菜单
     */
    public function getRoleMenuIds(): Json
    {
        return $this->service->getRoleMenuIds($this->params);
    }
}